import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'

// 导入全局样式
import './assets/css/index.css'

// 导入axios
import axios from 'axios'
axios.defaults.baseURL='http://www.tangxiaoyang.vip:8888/api/v2/'
// 拦截请求
axios.interceptors.request.use(config=>{
  // console.log(config)
  const userInfo=JSON.parse(sessionStorage.getItem('userInfo'))
  config.headers.Authorization=userInfo?userInfo.token:''
  return config
})
Vue.prototype.$http=axios

// 工具库
import utils from './libs/utils'
Vue.prototype.$utils = utils

import tools from './libs/tools'
Vue.prototype.$tools=tools


// 导入富文本编辑器
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme
Vue.use(VueQuillEditor)

//导入第三方工具

import ZkTable from 'vue-table-with-tree-grid'

Vue.component('table-tree', ZkTable)

Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
